import { Button } from 'react-vant';
import { useNavigate } from 'react-router-dom';
import '../assets/css/launch.scss'
export default function Launch() {
  const navigate = useNavigate();
  //点击选择角色
  const selectRole = (role: '老师' | '学生') => {
    sessionStorage.setItem('user', role)
    navigate('/login')

  }
  return (
    <div className='container'>
      <div className='box'>
        <Button type='primary' onClick={() => selectRole('老师')}>
          我是老师
        </Button>
        <div style={{ margin: '20px' }}></div>
        <Button type='warning' onClick={() => selectRole('学生')}>
          我是学生
        </Button>
      </div>
    </div>
  );
}
